
<?php 

include_once('class/autoload.php');
	$controleur = new controleur();
	$menu = $controleur->affiche_menu();
	
	// variables titre corps ......
	if(isset($_SESSION['pseudo'])||isset($_SESSION['admin'])){
		if(isset($_SESSION['admin'])){
			$site=new page_admin('accueil', $menu);
			
		}else{
		$site=new page_user('accueil', $menu);
		$site->corps="<script>submitForm()</script>";
		}
	}
	else{
		$site = new page_base('accueil', $menu);
		
		if (isset ( $_POST ['nomEcole'] )) {
			echo $_POST ['nomEcole'];
			$controleur->InscriptionSite();
			$site->corps="<script>submitForm('Inscription')</script>";
		}else{
			$site->corps="<script>submitForm()</script>";
		}
	}
	$site->titre = "Cross Usep 2014";
	$site->affiche();

?>